<%-- 
    Document   : editItem.jsp
    Created on : Apr 30, 2011, 8:49:25 PM
    Author     : christophe
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">


<%@include file="/WEB-INF/jspf/tagImports.jspf" %>

<html:html lang="true">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Check Out</title>
  </head>

  <tags:menu />
  <div id ="content">
    <tags:body>
      <span>
        <c:if test="${requestScope.inError}">
          <div id="errorMessage" style="color: red;">Please fill in any missing fields</div>
        </c:if>


        <c:url var="saveUrl" value="/user/doCheckout.do"/>
        <form action="${saveUrl}" method="post">
          <c:set var="cart" value="${sessionScope.cart}" />
          <c:set var="user" value="${sessionScope.user}" />
          <h2>Credit Card Information</h2>

          <tags:textInput formFieldName="creditCardNumber" labelName="Card Number" textValue="${CheckOutForm.creditCardNumber}" />
          <tags:textInput formFieldName="securityCode" labelName="Security Code" textValue="${CheckOutForm.securityCode}" />
          <tags:textInput formFieldName="expirationDate" labelName="Expiration Date" textValue="${CheckOutForm.expirationDate}" />

          <select name="cardType">
            <option value=""></option>
            <option value="VISA">VISA</option>
            <option value="MASTERCARD">Master Card</option>
            <option value="AMEX">American Express</option>
          </select>


          <h2>Billing Address</h2>

          <tags:textInput formFieldName="street" labelName="Street Address" textValue="${CheckOutForm.street}" />
          <tags:textInput formFieldName="city" labelName="City" textValue="${CheckOutForm.city}" />
          <tags:textInput formFieldName="state" labelName="State" textValue="${CheckOutForm.state}" />
          <tags:textInput formFieldName="zip" labelName="Zip Code" textValue="${CheckOutForm.zip}" />

          <br />

          

          <tags:textInput formFieldName="sStreet" labelName="Street Address" textValue="${CheckOutForm.sStreet}" />
          <tags:textInput formFieldName="sCity" labelName="City" textValue="${CheckOutForm.sCity}" />
          <tags:textInput formFieldName="sState" labelName="State" textValue="${CheckOutForm.sState}" />
          <tags:textInput formFieldName="sZip" labelName="Zip Code" textValue="${CheckOutForm.sZip}" />
          <tags:textInput formFieldName="phoneNumber" labelName="Phone Number" textValue="${CheckOut.cZip}" />


          <h2>Items in Cart</h2>
          <table style="border-style: solid;">
            <tr style="border-style: inherit;">
              <th>Name</th>
              <th>Description</th>
              <th>Category</th>
              <th>Price</th>
            </tr>
            <c:forEach var="item" items="${cart.items}" >
              <tr>
                <td><c:out value="${item.name}" /></td>
                <td><c:out value="${item.description}" /></td>
                <td style="color: ${item.itemCategory.labelColor}" ><c:out value="${item.itemCategory.name}" /> </td>
                <td><c:out value="${item.salePrice}" /></td>
              </tr>
            </c:forEach>
            <tr>
              <td> </td>
              <td> </td>
              <td>Total:</td>
              <td>${CheckOutForm.total}</td>
            </tr>
          </table>

          <input type="submit" value="Purchase Your Stuff" />

        </form>
      </span>
    </tags:body>
  </div>
  <div id = "footer">
    <span>
      &nbsp;All rights reserved Garage Sale 2011 | Legal | Privacy Policy
    </span>
    <br><br>
    <img alt="" src="../images/b1.gif">
    <img alt="" src="../images/b2.gif" style="margin:0px 5px 0px 5px">
    <img alt="" src="../images/b3.gif">
  </div>

</html:html>


